package cn.wmx.boot;

import org.apache.catalina.LifecycleException;
import org.apache.catalina.startup.Tomcat;

import javax.servlet.ServletException;

public class SpringBootApplication {

    public static void run() {
        Tomcat tomcat = new Tomcat();
        tomcat.setPort(9958);
        try {
            // 设置项目根路径，完成一些自动配置……………………………………
            tomcat.addWebapp("/", "E:\\");
            tomcat.start();
            // 监听关闭端口，阻塞程序执行完成之后直接结束
            tomcat.getServer().await();
        } catch (ServletException | LifecycleException e) {
            e.printStackTrace();
        } finally {
        }
    }
}
